package org.restql.db.operation;

import java.sql.Connection;
import java.sql.SQLException;

import org.restql.db.resource.DatabaseResource;
import org.restql.db.resource.RequestResource;

public abstract class DatabaseOperation {

	protected DatabaseResource databaseResource;
	protected RequestResource requestResource;

	protected DatabaseOperation(DatabaseResource databaseResource,
			RequestResource requestResource) {

		this.databaseResource = databaseResource;
		this.requestResource = requestResource;

	}

	protected Connection getConnection() throws SQLException {
		return this.databaseResource.getConnection(this.requestResource);
	}

}
